#include <stdio.h>
#include <math.h>
#include <string.h>


//Type-1 Clones - Krawitz
	float Type1a_Krawitz(int n)
	{
	int p = -1;
	int sum = 0;

	for (p = 0; p < n; p++)
	{
		sum += p;
	}

	if (n == 0) return sum;
	else return sum / n;
	}


int mult(int a, int b){
	return a*b;
}


	// Type 1 Clone - Krawitz
	float Type1b_Krawitz(int n)
	{
	int p = -1;
	int sum = 0;

	//this is a comment that is not in any other method()
	for (p = 0; p < n; p++)
		sum += p;

	if (n == 0)
		return sum;
	else
		return sum / n;
	}

	
	

	//Type-2 Clones - Krawitz
	float Type2a_Krawitz(int n)
	{
	int q = -1;
	double sum = 0;

	for (q = 0; q < n; q++)
	{
	sum += q;
	}

	if (n == 0) return sum;
	else return sum / n;
	}

	//Type-2 Clones - Krawitz
	float Type2b_Krawitz(int t)
	{
	int p = -1;
	int tot = 0;

	//this is a comment that is not the same as any other comment
	for (p = 0; p < t; p++)
	tot += p;

	if (t == 0)
	return tot;
	else
	return tot / t;
	}

		
	// type 3 clone from Krawitz
	float Type3a_Krawitz(int n)
	{
	int q = -1;
	double sum = 0;

	q = 0;
	while(q < n)
	{
	sum += q;
	q++;
	}

	if (n == 0) return sum;
	else return sum / n;
	}

	// type 3 clone - Krawitz
	float Type3b_Krawitz(int t)
	{
	int p = -1, tot = 0;

	//this is another unique comment
	for (p = 0; p < t; p++)
		tot += p;

	if (t == 0)
		return (double)tot;
	else
		return (double)tot / t;
	}



	



void main()
{
	printf("Hello world!\n");


	printf("mult %d \n", mult(5,2));

printf("Type1a_Krawitz: %lf \n", Type1a_Krawitz(4));
printf("Type1b_Krawitz: %lf \n", Type1b_Krawitz(4));
printf("Type2a_Krawitz: %lf \n", Type2a_Krawitz(4));
printf("Type2b_Krawitz: %lf \n", Type2b_Krawitz(4));
printf("Type3a_Krawitz: %lf \n", Type3a_Krawitz(4));
printf("Type3b_Krawitz: %lf \n", Type3b_Krawitz(4));


//sumProd4A(4);



//	printf("\n\n\n\n\n\n\n\n");
//	system("pause");
}



